package com.zx.mq.pubsub;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 三个消费者分别监听三个队列的内容
 */
@Component
@RabbitListener(queues = "fanout.B")
public class PubSubReceiveB {

    @RabbitHandler
    public void process(String msg) throws InterruptedException {
        System.out.println("ReceiverB doing..."+msg);
        Thread.sleep(1000);
    }
}
